SET(SOURCE_FILES
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_do.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_exception.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_utils.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_utils.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_cache.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_cache.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_config.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_config.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_algorithm.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_algorithm.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_video.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_video.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_zk.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_zk.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_rocketmq.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_rocketmq.h
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_http.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/vas_http.h
        )

SET(UNIT_TESTS
        ${CMAKE_CURRENT_SOURCE_DIR}/test/vas_utils_test.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/test/vas_cache_test.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/test/vas_config_test.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/test/vas_algorithm_test.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/test/vas_video_test.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/test/vas_zk_test.cpp
        )

SET(MAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
SET(TEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp)

FIND_PACKAGE(GTest CONFIG REQUIRED)
find_package(spdlog REQUIRED)
FIND_PACKAGE(jsoncpp REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED)
FIND_PACKAGE(zookeeper REQUIRED)
find_package(Pistache 0.0.2 REQUIRED)

INCLUDE_DIRECTORIES(
        GTest::gtest
        spdlog::spdlog
        jsoncpp_lib
        ${OpenCV_INCLUDE_DIRS}
        ${ZOOKEEPER_INCLUDE_DIRS}
        pistache_shared
)

ADD_EXECUTABLE(${PROJECT_NAME} ${MAIN_FILE} ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(
        ${PROJECT_NAME}
        spdlog::spdlog
        jsoncpp_lib
        ${OpenCV_LIBS}
        ${ZOOKEEPER_LIBRARIES}
        pistache_shared
)

ADD_EXECUTABLE(TEST ${TEST_FILE} ${SOURCE_FILES} ${UNIT_TESTS})
TARGET_LINK_LIBRARIES(
        TEST
        spdlog::spdlog
        GTest::gtest
        jsoncpp_lib
        ${OpenCV_LIBS}
        ${ZOOKEEPER_LIBRARIES}
        pistache_shared
)